﻿using EGN_Extractor;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;

namespace EGN_Extractor
{
    
 
    [TestClass()]
    public class EgnExtractorTest
    {

        [TestMethod()]
        public void ExtractEgnsTest()
        {
            string filename = @"C:\Users\User\Documents\visual studio 2010\Projects\"+
               @"Exam_DelagatesRegexStringsInputOutput\EGN Extractor\bin\Debug\persons.txt";
            List<string> expected = new List<string>() { "4806182906", "6203120707", "6711287769" };
            List<string> actual;
            actual = EgnExtractor.ExtractEgns(filename);

            Assert.AreEqual(expected.Count, actual.Count);

            for (int i = 0; i < expected.Count; i++)
            {
                Assert.AreEqual(expected[i], actual[i]);
            }
        }

        [TestMethod()]
        public void ExtractEgnsWithNoEgnsFoundTest()
        {
            string filename = @"C:\Users\User\Documents\visual studio 2010\Projects\"+
                @"Exam_DelagatesRegexStringsInputOutput\EGN Extractor\bin\Debug\personsWithoutEGNs.txt";
            List<string> expected = new List<string>();
            List<string> actual;
            actual = EgnExtractor.ExtractEgns(filename);

            Assert.AreEqual(expected.Count, actual.Count);
        }
    }
}
